from django.db import models
from django.contrib.auth.models import AbstractUser  # django自带user类
import datetime

class MapUser(AbstractUser):
    '''
    @brief: 继承AbstractUser类 继承 username,password,email等基础字段
    '''
    idol = models.CharField(max_length=20,default='dhf',verbose_name='偶像',help_text='record your idol')
    join_event = models.CharField(max_length=100,default='None',verbose_name='加入运动的事件',help_text='record your join_event')
    own_photo = models.ImageField(upload_to='photo/Avatar',verbose_name='头像',help_text='upload your own phto')
    own_interest = models.CharField(max_length=100,default='None',verbose_name='个人兴趣')
    sex = models.IntegerField(default=1,verbose_name='性别',help_text='1 is man and 0 is women')
    birthDay = models.DateField(default=datetime.date.today,verbose_name='出生日期',help_text='your born day')
    favorite_star = models.CharField(max_length=20,default='dhf',verbose_name='喜欢的明星',help_text='record your favorite_star')
    class Meta:
        # table name
        db_table = 'MapUser'
        verbose_name = '基础用户信息'
        verbose_name_plural = verbose_name
    def __str__(self):
        return self.username


